home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_hr.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-06-07  |  5.8 KB  |  124 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="310" caption="Horizontal line">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblLength" caption="Length" hint="Choose the length of the horizontal line." width="45" height="13" top="8" left="8"/>
  6.             <label name="lblSize" caption="Height" hint="Choose how high you want the horizontal line." width="51" height="13" top="56" left="8"/>
  7.             <spinedit name="speWidth" taborder="0" hint="Choose the length of the horizontal line." maxvalue="10000" minvalue="1" value="100" width="65" height="20" top="24" left="8"/>
  8.             <spinedit name="speSize" taborder="2" hint="Choose how high you want the horizontal line." maxvalue="0" minvalue="0" width="65" height="20" top="72" left="8"/>
  9.             <checkbox name="cbShadow" caption="3D shadow" taborder="3" hint="Choose whether you want 3D shadow on your horizontal line or not." checked="1" width="80" height="17" top="106" left="8"/>
  10.             <checkbox name="cbLengthInPercent" caption="%" taborder="1" hint="Should the length be in pixels or percentages?" checked="1" width="80" height="17" top="26" left="80"/>
  11.             <radiobutton name="rbAlignLeft" caption="Align left" taborder="4" hint="Choose how your horizontal line should be placed." checked="0" width="90" height="17" top="10" left="168"/>
  12.             <radiobutton name="rbAlignCenter" caption="Align center" taborder="5" hint="Choose how your horizontal line should be placed." checked="1" width="90" height="17" top="26" left="168"/>
  13.             <radiobutton name="rbAlignRight" caption="Align right" taborder="6" hint="Choose how your horizontal line should be placed." checked="0" width="90" height="17" top="44" left="168"/>
  14.         </panel>
  15.     </controls>
  16.     <dialogevents>
  17.         <event type="onclose" resulttype="ok">
  18.               StartCode := '<hr';
  19.               If (speWidth.Value <> 100) OR (cbLengthInPercent.Checked = false) then
  20.                begin
  21.                StartCode := StartCode + ' width="'+IntToStr(speWidth.Value);
  22.                 If cbLengthInPercent.Checked then
  23.                   StartCode := StartCode + '%"'
  24.               else
  25.                 StartCode := StartCode + '"';
  26.               end;  
  27.                
  28.               If rbAlignCenter.Checked = false then
  29.                begin
  30.                 If rbAlignLeft.Checked then 
  31.                StartCode := StartCode + ' align="left"'
  32.               else 
  33.                StartCode := StartCode + ' align="right"';
  34.              end;
  35.             If speSize.Value > 0 then
  36.              StartCode := StartCode + ' size="'+IntToStr(speSize.Value)+'"';
  37.               If cbShadow.Checked = false then
  38.              StartCode := StartCode + ' noshade';
  39.     
  40.               If edtCSSClass.Text <> '' then
  41.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  42.               If edtCSSId.Text <> '' then
  43.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  44.               If edtCSSStyle.Text <> '' then
  45.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  46.  
  47.             for i := 0 to EventGrid.Count - 1 do
  48.               begin
  49.               if EventGrid.Rows[i].EditText <> '' then
  50.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  51.              end;  
  52.             StartCode := StartCode + '>';
  53.  
  54.             If cbMakeXHTMLCompliant.Checked then
  55.              StartCode := MakeXHTMLCompliant(StartCode, false);
  56.             If cbDoPHPEscape.Checked then
  57.              StartCode := DoPHPEscape(StartCode);         
  58.             // A little "hack" - WebCoder will set this, to let us know whether to update
  59.             // an existing tag, or insert a brand new one
  60.             If cbUpdateExistingTag.Checked then 
  61.              ReplaceTag(StartCode)
  62.             else 
  63.                InsertTags(StartCode, '');   
  64.               
  65.         </event>
  66.         <event type="onshow">    
  67.             // Lets put the advanced panel in the right place
  68.             pnlAdvanced.Parent := MainPanel;
  69.             pnlAdvanced.Left := 8;
  70.             pnlAdvanced.Top := MainPanel.Height - 32;        
  71.             pnlAdvanced.Width := Self.Width - 36;
  72.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  73.             If pnlAdvanced.Height > 20 then
  74.              Self.Height := Self.Height + 200;
  75.         </event>
  76.         <event type="updatedialog">
  77.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  78.             // The entire selected tag will be passed as a parameter to this function, that should update
  79.             // the required fields of the dialog.
  80.             function UpdateDialog(Tag: string);
  81.              begin
  82.               Width := GetValueFromAttribute(Tag, 'width');
  83.               If Width[Length(Width)] = '%' then
  84.                begin
  85.                 Delete(Width, Length(Width), 1);
  86.                 cbLengthInPercent.Checked := true;
  87.                end
  88.               else
  89.                cbLengthInPercent.Checked := false; 
  90.               If Width <> '' then 
  91.                begin
  92.                  speWidth.Value := StrtoInt(Width);
  93.                 end
  94.               else
  95.                cbLengthInPercent.Checked := true;      
  96.               Align := Lowercase(GetValueFromAttribute(Tag, 'align'));
  97.               If Align = 'left' then
  98.                rbAlignLeft.Checked := true;              
  99.               If Align = 'center' then
  100.                rbAlignCenter.Checked := true;
  101.               If Align = 'right' then
  102.                rbAlignRight.Checked := true;             
  103.               If GetValueFromAttribute(Tag, 'size') <> '' then
  104.                   speSize.Value := StrtoInt(GetValueFromAttribute(Tag, 'size'));  
  105.           
  106.                 cbShadow.Checked := not HasOption(Tag, 'noshade'); 
  107.         
  108.             
  109.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  110.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  111.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  112.               for i := 0 to EventGrid.Count - 1 do
  113.                 begin
  114.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  115.                  If EventVal <> '' then
  116.                   EventGrid.Rows[i].EditText := EventVal;
  117.                end;  
  118.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  119.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  120.              end;
  121.         </event>
  122.     </dialogevents>
  123. </dialog>
  124.